home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / POV-Ray 3.0.2 / src / MacSource / FilePrefs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-14  |  6.5 KB  |  194 lines  |  [TEXT/CWIE]

  1. /*==============================================================================
  2. Project:    POV-Ray
  3.  
  4. Version:    3
  5.  
  6. File:    FilePrefs.h
  7.  
  8. Description: File/rendering preferences dialog handling code
  9. ------------------------------------------------------------------------------
  10. Author:
  11.     Eduard [esp] Schwan
  12. ------------------------------------------------------------------------------
  13.     from Persistence of Vision(tm) Ray Tracer
  14.     Copyright 1996 Persistence of Vision Team
  15. ------------------------------------------------------------------------------
  16.     NOTICE: This source code file is provided so that users may experiment
  17.     with enhancements to POV-Ray and to port the software to platforms other 
  18.     than those supported by the POV-Ray Team.  There are strict rules under
  19.     which you are permitted to use this file.  The rules are in the file
  20.     named POVLEGAL.DOC which should be distributed with this file. If 
  21.     POVLEGAL.DOC is not available or for more info please contact the POV-Ray
  22.     Team Coordinator by leaving a message in CompuServe's Graphics Developer's
  23.     Forum.  The latest version of POV-Ray may be found there as well.
  24.  
  25.     This program is based on the popular DKB raytracer version 2.12.
  26.     DKBTrace was originally written by David K. Buck.
  27.     DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
  28. ------------------------------------------------------------------------------
  29. Change History:
  30.     941230    [esp]    Created
  31.     950417    [esp]    Updates for version 3
  32.     950629    [esp]    Changed fPrf to FPRF per registry with Apple
  33.     960704    [esp]    Changed version to 3.0 final, prepare for release
  34. ==============================================================================*/
  35.  
  36. #ifndef FILEPREFS_H
  37. #define FILEPREFS_H
  38.  
  39.  
  40. #include "config.h"
  41.  
  42. #include "Animate.h"    // AnimRec_t
  43.  
  44. /*==== Macintosh-specific headers ====*/
  45. #include <types.h>
  46. #include <files.h>
  47.  
  48.  
  49. /*==== definitions ====*/
  50.  
  51. // 16 bit unsigned integer, used as simple flags/values in preference files
  52. typedef unsigned short int        UINT16_t;
  53.  
  54. // the resource ID of the preferences resource (POV-Ray v1.0=128, 2.0=200, 3.0=300)
  55. #define    kFilePrefs_rsrcID    300
  56. // the resource type
  57. #define    kFilePrefsRsrc    'FPRF'
  58.  
  59. // The version # of the prefs resources - increment this when prefs_rec_t's change.
  60. // This currently follows the app version #, so 8352 is version
  61. //    8            3            5            2
  62. //    (beta)        3.0            release 5    Mac build 2
  63. //    Final release will clear the high nybble (83XX will become 03XX)
  64.  
  65. #define    kFilePrefs_Vers        0x0300
  66.  
  67.  
  68. /*==== preferences resource - File ====*/
  69.  
  70. // Progress item values
  71. enum {
  72.     eProgNone        = 0,    // quiet
  73.     eProgMac,                // Mac info
  74.     eProgVerbose,            // Mac & Core info
  75.     eProgDebug,                // Mac debug info
  76.     eProgMax        = eProgDebug
  77. };
  78.  
  79. // Output file values
  80. enum {
  81.     eOutfNone        = 0,    // no output file
  82.     eOutfTarga,                // uncompressed targa
  83.     eOutfTargaC,            // compressed RLE targa
  84.     eOutfPNG,                // PNG
  85.     eOutfPPM,                // Unix ppm file
  86.     eOutfSystem,            // Native system format (PICT) unused since its default
  87.     eOutfMax        = eOutfSystem
  88. };
  89.  
  90. // Min language version values (+mv)
  91. enum {
  92.     eMLPOV1        = 1,        // POV-Ray 1.0
  93.     eMLPOV2        = 2,        // POV-Ray 2.0
  94.     eMLPOV3        = 3,        // POV-Ray 3.0
  95.     eMinLangVersion    = eMLPOV1,
  96.     eMaxLangVersion    = eMLPOV3
  97. };
  98.  
  99. #define kMaxOutfileBuffSize        5
  100.  
  101.  
  102. #define kMinBitsPerColor         5
  103. #define    kMaxBitsPerColor        16
  104.  
  105.  
  106. // This resource/struct will be saved to disk, and should match
  107. // its 68K equivalent...
  108. #if GENERATINGPOWERPC
  109. #pragma options align=mac68k
  110. #endif
  111.  
  112. typedef struct
  113. {
  114.     UINT16_t    prefsVersion;        // magic version # of this record (kFilePrefs_rsrcVers)
  115.  
  116.     Rect        srcWind_pos;        // source window placement on screen
  117.     Rect        statWind_pos;        // status window placement
  118.     Rect        imageWind_pos;        // image window placement
  119.     Point        LastPrefsDlgPos;    // position of prefs mmodal dialog
  120.  
  121.     UINT16_t    imageWidth;            // width of image in pixels (+W)
  122.     UINT16_t    imageHeight;        // height of image in pixels (+H)
  123.     Point        imageUpperLeft;        // image scroll position within window
  124.     Rect        selectionArea;        // image selection area within window (+SC/+EC/+SR/+ER)
  125.  
  126.     OSType        pictFileCreator;    // PICT file creator
  127.     OSType        targaFileCreator;    // Targa file creator
  128.  
  129.     UINT16_t    doCreateINI;        // Create_Ini=filename
  130.  
  131.     UINT16_t    renderQuality;        // quality index for image (+Q 0-9)
  132.     UINT16_t    radQuality;            // radiosity flag (0-1)
  133.     UINT16_t    custom_palette;        // style of palette to use (-1, 0...4)
  134.     UINT16_t    imageMagFactor;        // magnification factor of image window (0,1,2,3,4)
  135.  
  136.     UINT16_t    outfileType;        // output file 0=none, 1=targa, etc
  137.     UINT16_t    outfileBuffSize;    // Output file buffer size (0,1-4) (+Bn)
  138.     UINT16_t    continueTarga;        // True to use previous Targa file
  139.     UINT16_t    bitsPerColor;        // # of bits per color for pixels in image (1,2,4,8,16,32) (Bits_Per_Color=nn)
  140.     UINT16_t    doAlphaChannel;        // True to add alpha channel output (+UA)
  141.     UINT16_t    doDither;            // True to dither image
  142.     UINT16_t    doPictCompression;    // True if compressing image
  143.  
  144.     UINT16_t    doBoundSlabs;        // True to use bounding slabs (+MB)
  145.     UINT16_t    boundSlabThreshold;    // Min. # of objects before enabling slabs
  146.  
  147.     UINT16_t    progress;            // levels of verbose progress during render (1-4) (+V1)
  148.     UINT16_t    languageVersion;    // for POV-Ray +MV command
  149.  
  150.     UINT16_t    previewStart;        // 0=none, 1,2,4,8.. = starting grid size (+MPnn)
  151.     UINT16_t    previewEnd;            // 0=none, 1,2,4,8.. = ending grid size (+EPnn)
  152.  
  153.     UINT16_t    doAntialias;        // True if antialiasing
  154.     UINT16_t    antialiasMethod;    // which method, 1 or 2
  155.     float        antialiasThreshold;    // value of anti-alias threshold
  156.     UINT16_t    antialiasDepth;        // for POV-Ray +R command
  157.     float        antiJitterScale;    // for POV-Ray +J command
  158.  
  159.     UINT16_t    doSplitUnions;        // (+SU)
  160.     UINT16_t    doVistaBuffer;        // (+UV)
  161.     UINT16_t    doLightBuffer;        // (+UL)
  162.     UINT16_t    doVistaDraw;        // (+UD)
  163.     UINT16_t    removeBounds;        // (+UR)
  164.  
  165.     UINT16_t    doHistogram;        // Histogram
  166.     UINT16_t    histogramType;        // Histogram_type
  167.     UINT16_t    histogramXSize;        // Histogram_Grid_Size
  168.     UINT16_t    histogramYSize;        // Histogram_Grid_Size
  169.  
  170.     UINT16_t    doFieldRender;        // Field_Render=on
  171.     UINT16_t    doOddField;            // Odd_Field=on
  172.  
  173.     UINT16_t    doAnimation;        // True if doing animation
  174.     AnimRec_t    animRec;            // animation info record
  175.  
  176.     SCSpatialSettings    sc_DialogParams;
  177. } file_prefs_rec_t, *file_prefs_ptr_t, **file_prefs_hdl_t;
  178.  
  179. #if GENERATINGPOWERPC
  180. #pragma options align=reset
  181. #endif
  182.  
  183.  
  184. /*==== globals ====*/
  185. extern file_prefs_hdl_t    gFilePrefs_h;        // each file has its own prefs
  186. extern file_prefs_hdl_t    gPrefs2Use_h;        // points to file or default prefs
  187.  
  188.  
  189. /*==== prototypes ====*/
  190. void FilePrefs_Write(short src_wdrefnum, StringPtr src_fname);
  191. void FilePrefs_Read(short src_wdrefnum, StringPtr src_fname);
  192. void FilePrefs_Prompt_Init(short src_wdrefnum, StringPtr src_fname);
  193.  
  194. #endif // FILEPREFS_H